package bug.buffs
{
	import flash.utils.getTimer;

	public class BuffData
	{
		
		public var speed:Number=0;
		public var growSpeed:Number=0;
		public var duration:int=1000;//持续时间
		public var antCount:int=0;
		private var _isTimeOut:Boolean;
		private var _startTime:Number=0;
		private var _isEnemy:Boolean;
		private var _icon:String;
		public var id:int;
		public var power:int;
		
		public function BuffData(x:XML)
		{
			//var x:XML = _buffData.item.(@id==id)[0];
			speed=x.@speed;
			id=x.@id;
			growSpeed=x.@growSpeed;
			antCount = x.@antCount;
			_icon=x.@icon;
			power = x.@power;
		}

		public function get icon():String
		{
			return _icon;
		}

		public function get isEnemy():Boolean
		{
			return _isEnemy;
		}

		public function get isTimeOut():Boolean
		{
			return _isTimeOut;
		}

		public function add(buff:BuffData):void{
		    
		}
		
		public function updata():void{
		    if(_startTime==0){
			    _startTime=getTimer();
			}
			if(getTimer()-_startTime>=duration){
			    _isTimeOut=true;
			}
		}
	}
}